package com.api.shopapi.mapper;

import com.api.shopapi.entity.ActivityOrderRecord;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ActivityOrderRecordMapper {


    @Insert("insert into activity_order_record " +
            "(" +
            "ActivityOrderRecordCode," +
            "ActivityOrderCode," +
            "Text," +
            "CreateTime" +
            ") " +
            "values " +
            "(" +
            "#{activityOrderRecord.ActivityOrderRecordCode}," +
            "#{activityOrderRecord.ActivityOrderCode}," +
            "#{activityOrderRecord.Text}," +
            "#{activityOrderRecord.CreateTime}" +
            ")" )
    int insert(@Param("activityOrderRecord") ActivityOrderRecord activityOrderRecord);


    @Delete("delete from activity_order_record where activityOrderRecordCode=#{activityOrderRecordCode}")
    int delete(@Param("activityOrderRecordCode") String activityOrderRecordCode);


    @Select("select * from activity_order_record where activityOrderRecordCode=#{activityOrderRecordCode} limit 1")
    ActivityOrderRecord getByActivityOrderRecordCode(@Param("activityOrderRecordCode") String activityOrderRecordCode);


    @Select("select * from activity_order_record where activityOrderCode=#{activityOrderCode}")
    List<ActivityOrderRecord> ListByActivityOrderCode(@Param("activityOrderCode") String activityOrderCode);


}
